package cn.iocoder.yudao.module.student.controller.app.studentShow;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.api.studentShow.StudentShowApi;
import cn.iocoder.yudao.module.member.api.studentShow.dto.StudentShowPageReqDTO;
import cn.iocoder.yudao.module.member.api.studentShow.dto.StudentShowRespDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Api(tags = "管理后台 -学生端- 学生风采")
@RestController
@RequestMapping("/student/studentShow")
@Validated
public class WebStudentShowController {

    @Resource
    private StudentShowApi studentShowApi;


    @GetMapping("/get")
    @ApiOperation("获得学生风采")
    @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
    public CommonResult<StudentShowRespDTO> getStudentShow(@RequestParam("id") Long id) {
        StudentShowRespDTO studentShow = studentShowApi.getStudentShow(id);
        return success(studentShow);
    }


    @GetMapping("/page")
    @ApiOperation("获得学生风采分页")
    public CommonResult<PageResult<StudentShowRespDTO>> getStudentShowPage(@Valid StudentShowPageReqDTO pageVO) {
        PageResult<StudentShowRespDTO> pageResult = studentShowApi.getStudentShowPage(pageVO);
        return success(pageResult);
    }


}
